﻿<!DOCTYPE html>
<html lang="zh-cn" data-qqkey="" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>用户登录</title>
    <meta name="format-detection" content="telephone=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/> <!-- apple devices fullscreen -->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <link rel="shortcut icon" href="/static/copy/picture/atxx1bundbvtx1vbdvtbbtb2zvcbbb.jpg"/>
    <script src="/static/copy/js/jweixin-1.4.0.js"></script>
    <script type="text/javascript" src="/static/copy/js/util.js"></script>
    <script src="/static/copy/js/require.js"></script>
    <script type="text/javascript" src="/static/copy/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/static/copy/js/mui.min.js"></script>
    <script type="text/javascript" src="/static/copy/js/common.js"></script>
    <link href="/static/copy/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/copy/css/common.min.css" rel="stylesheet">
    <script type="text/javascript">
        if (navigator.appName == 'Microsoft Internet Explorer') {
            if (navigator.userAgent.indexOf("MSIE 5.0") > 0 || navigator.userAgent.indexOf("MSIE 6.0") > 0 || navigator.userAgent.indexOf("MSIE 7.0") > 0) {
                alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
            }
        }
        window.sysinfo = {
            'uniacid': '17', 'acid': '17', 'siteroot': 'http://888.huipin.co/',
            'siteurl': 'http://888.huipin.co/app/index.php?i=17&c=auth&a=login&forward=aT0xNyZjPWVudHJ5Jm09cmVjaGFyZ2UmZG89cGF5Jnd4cmVmPW1wLndlaXhpbi5xcS5jb20%3D&wxref=mp.weixin.qq.com',
            'attachurl': 'http://888.huipin.co/attachment/',
            'attachurl_local': 'http://888.huipin.co/attachment/',
            'attachurl_remote': '',
            'cookie': {'pre': '03ad_'}
        };
        // jssdk config 对象
        jssdkconfig = null || {};
        // 是否启用调试
        jssdkconfig.debug = false;
        jssdkconfig.jsApiList = [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard',
            'openAddress'
        ];
    </script>
</head>
<body>
<div class="container container-fill">
    <!--<script>
        $(function () {
            $(document).on('input propertychange', '.js-mobile-val', function () {
                var mobile_value = $(this).val();
                if (mobile_value.length == '11') {
                    $.post("./index.php?i=17&c=auth&a=login&do=mobile_exist&", {'mobile': mobile_value}, function (data) {
                        data = $.parseJSON(data);
                        if (data.message.errno == '1') {
                            $('.js-check-mobile').addClass('send-code');
                        } else if (data.message.errno == '2') {
                            $('.js-check-mobile').removeClass('send-code');
                            util.toast('手机号不存在', '', 'error');
                            return;
                        }
                    });
                } else {
                    $('.js-check-mobile').removeClass('send-code');
                }
            });
            $(document).on('click', '.login-code', function () {
                var username = $('#login-code input[name="username"]').val();
                var password = $('#login-code input[name="password"]').val();
                $.post(location.href, {'username': username, 'password': password, 'mode': 'code'}, function (data) {
                    data = $.parseJSON(data);
                    if (data.type != 'success') {
                        util.toast(data.message, '', 'error');
                    } else {
                        util.toast('登录成功');
                        location.reload();
                    }
                })
            })
            $(document).on('click', '.send-code', function () {
                var username = $('#login-code input[name="username"]').val();
                option = {
                    'btnElement': $('.send-code'),
                    'showElement': $('.js-timer'),
                    'btnTips': '<a class="send-code">重新获取验证码</a>',
                    'successCallback': function (ret, message) {
                        if (ret == '0') {
                            util.toast(message);
                            $('.js-sendcode').hide();
                            $('.js-codeverify').show();
                        } else {
                            util.toast(message);
                            $('.js-sendcode').show();
                            $('.js-codeverify').hide();
                            return;
                        }
                    }
                };
                util.sendCode(username, option);
            });
        });
    </script>-->
    <div class="mui-content mc-login">
        <div class="avatar mui-text-center">
            <img src="/static/copy/picture/headimg_17.jpg" class="mui-img-circle"/>
        <label>您尚未登录</label>
        </div>
        <form action="" method="post" enctype="multipart/form-data"
              class="js-ajax-form">
            <div class="mui-control-content mui-active" id="login-basic">
                <div class="mui-input-group">
                    <div class="mui-input-row">
                        <label class="mui-label-icon"><i class="fa fa-user"></i></label>
                        <input name="username" type="text" placeholder="手机号/邮箱" />
                    </div>
                    <div class="mui-input-row mui-help">
                        <label class="mui-label-icon"><i class="fa fa-lock"></i></label>
                        <input name="password" type="password" placeholder="密码"/>
                        <div class="mui-help-info mui-text-right"><a
                                href="javascript:inform()">忘记密码</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="mui-content-padded">
                <button class="mui-btn mui-btn-success mui-btn-block login-basic" type="button" id="submit">
                    登录
                </button>
            </div>
        </form>
        <div class="mui-content-padded">
            <div class="mui-text-center mui-mt15">还没有帐号?
                <a href="/user/regist">注册账号</a>
                <span class="mui-ml5 mui-mr5 mui-text-muted">|</span>
                <a href="javascript:inform()">无密码登录
                </a>
            </div>
        </div>
    </div>
</div>
<script>
    function inform() {
        util.toast("维护中..");
        return false;
    }

    $(function () {
        $("#submit").click(function () {
            var array=$('.js-ajax-form').serializeArray();
            for(var i=0;i<array.length;i++){
                if(array[i].value==""){
                    util.toast("账号或密码不能为空", '', 'error');
                    return;
                }
//                if(array[i].value.length<=3){
//                    util.toast("账号或密码长度太短", '', 'error');
//                    return;
//                }
            }
            $.post("/user/login", array, function (data) {
                if (data.status == 200) {
                    util.toast(data.msg,data.data);
                } else {
                    util.toast(data.msg, '', 'error');
                }
            })
        });
    })

</script>
</body>
</html>